import pytest
from selenium import webdriver
from zuokao3moni.Page import Page
from time import sleep
from zuokao3moni.Page2 import Page2

@pytest.fixture()
def driver():
    driver=webdriver.Chrome()
    driver.maximize_window()
    yield driver
    driver.close()

def test_login(driver):
    po1=Page(driver)
    po1.open_url('http://10.59.9.14:7003/')
    sleep(2)
    po1.login_please()
    sleep(2)
    print(po1.dy1())
    po1.send_user()
    sleep(2)
    po1.send_power()
    sleep(6)
    po1.login_button()
    sleep(4)

def test_01(driver):
    test_login(driver)
    po2=Page2(driver)
    po2.send_shuru()
    sleep(2)
    po2.click_sousuo()
    sleep(2)
    print(po2.dy2)